{include file='common/_meta' /}
<body id="iosiframe">
<div class="container">
	<div class="layui-row">
        <div class="layui-col-md12 breadcrumb">
    		<span class="layui-breadcrumb">
    			<a><cite>财务管理菜单</cite></a>
    			<a><cite>充值记录</cite></a>
    		</span>
        </div>
    </div>

    <div class="layui-row">

    	<form class="layui-form" action="" lay-filter="" style="padding-top: 15px;">

            <div class="layui-col-sm6 layui-col-md4">
                <div class="layui-form-item">
                    <label class="layui-form-label">开始时间：</label>
                    <div class="layui-input-block">
                        <input type="text" name="st" autocomplete="off" placeholder="" class="layui-input" id="st">
                    </div>
                </div>
            </div>

            <div class="layui-col-sm6 layui-col-md4">
                <div class="layui-form-item">
                    <label class="layui-form-label">结束时间：</label>
                    <div class="layui-input-block">
                        <input type="text" name="et" autocomplete="off" placeholder="" class="layui-input" id="et">
                    </div>
                </div>
            </div>

    		<div class="layui-col-sm6 layui-col-md4">
				<div class="layui-form-item">
				    <label class="layui-form-label">操作类型：</label>
				    <div class="layui-input-block">
			     	 	<select name="oty">
				        	<option value="">全部</option>
				        	{volist name='recordope' id='rec'}
				        	<option value="{$rec.id}">{$rec.ope_type}</option>
				        	{/volist}
				      	</select>
				    </div>
			  	</div>
    		</div>
    		<div class="layui-col-sm6 layui-col-md4">
				<div class="layui-input-block">
			      	<button class="layui-btn custom-sm-fluid custom-md-fluid" lay-submit lay-filter="custom-search">搜索</button>
			    </div>
    		</div>

    	</form>

    </div>

	<div class="layui-col-md12">

		<table class="layui-hide" id="initdate" lay-filter="datatable"></table>

        <script type="text/html" id="barDemo">
          	<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="remarks"><i class="layui-icon layui-icon-file-b"></i></a>
        </script>

	</div>

</div>

{include file="common/_footer"}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
layui.use(['layer', 'form', 'table', 'laydate'], function() {

	var table   = layui.table;
	var layer   = layui.layer;
	var form    = layui.form;
	var laydate = layui.laydate;

	//绑定时间插件
    laydate.render({
        elem: '#st'
        ,type: 'datetime'
        ,value: '{$requests.st}'
        ,max: '{$requests.et}'
    });

    laydate.render({
        elem: '#et'
        ,type: 'datetime'
        ,value: '{$requests.et}'
    });

    var tableIns = table.render({
        elem: '#initdate'
        ,url:'{:url('Record/index')}'
        ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        ,method:'get'//请求方式
        ,where: {api: 1}
        ,page:true//开启分页
        ,limit:15//每页记录数
        ,limits: [15,20,30,40,50,60,70,80,90]
        ,cols: [{$field_list|raw}]
    });

    //监听工具条
  	table.on('tool(datatable)', function(obj) {

        var data = obj.data;

        switch(obj.event) {

            case 'remarks':
                layer.open({
                    type: 2,
                    title: '备注',
                    area: ['100%', '100%'],
                    content: "{:url('Record/remarks_up')}?id=" +  data.id
                });
                break;
        };

    });

  	// 监听搜索事件
    form.on('submit(custom-search)', function(data) {

      	tableIns.reload({
        	where: {
                st: data.field.st
	          	,et: data.field.et
	          	,oty: data.field.oty
	          	,channel_id: data.field.channel_id
	          	,api: 1
        	}
        	,page: {curr: 1 }
      	});

        $(window).resize()

      	return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });

});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>